﻿//=====================================================================================================
// LocalizationLibrary
// The Localization Library is a collection of reusable software components that provide 
// support for localization. This library enables you to localize WPF, Silverlight and WP7 applications.
// (http://localizationlibrary.codeplex.com)
//=====================================================================================================
// Author: Nicola Gallo (Website: www.nicola.gallo.name, Email: nicolagmt@hotmail.it) 
//=====================================================================================================

namespace LocalizationLibrary.Tests.Core
{
    //.NET References
    using System;
    using System.Text;
    using System.Collections.Generic;
    using System.Linq;

    // Microsoft References
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    [TestClass]
    public class StaticResourceTest
    {
        [TestMethod]
        public void New_Instance_Should_Assigns_All_Properties()
        {
            String key = Guid.NewGuid().ToString();
            Type resourceType = this.GetType();

            StaticResource instance = new StaticResource(key, resourceType);

            Assert.AreEqual(instance.Key, key);
            Assert.AreSame(instance.ResourceType, resourceType);
        }

        [ExpectedException(typeof(ArgumentException))]
        [TestMethod]
        public void New_Instance_Thrown_ArgumentException_If_Key_Is_Null()
        {
            StaticResource instance = new StaticResource(null, this.GetType());
        }

        [ExpectedException(typeof(ArgumentException))]
        [TestMethod]
        public void New_Instance_Thrown_ArgumentException_If_Key_Is_Equals_To_White_Space()
        {
            StaticResource instance = new StaticResource(String.Empty, this.GetType());
        }

        [ExpectedException(typeof(ArgumentNullException))]
        [TestMethod]
        public void New_Instance_Thrown_ArgumentNullException_If_ResourceType_Is_Null()
        {
            StaticResource instance = new StaticResource(Guid.NewGuid().ToString(), null);
        }
    }
}